package com.yyy.demo;

import org.json.JSONArray;
import org.json.JSONObject;

public class Demo1 {
	public static void main(String[] args) {
		String json = "{\"action\":\"DescribeVolumesResponse\",\"total_count\":1,\"volume_set\":[{\"status\":\"in-use\",\"description\":null,\"volume_name\":\"vol 2\",\"sub_code\":0,\"transition_status\":\"\",\"instance\":[{\"instance_id\":\"i-ogbndull\",\"instance_name\":\"\"}],\"create_time\":\"2013-08-30T05:13:25Z\",\"volume_id\":\"vol-g7xy7d6g\",\"status_time\":\"2013-08-30T05:13:32Z\",\"size\":10}],\"ret_code\":0}";

		JSONObject jo = new JSONObject(json);
		JSONArray ja1 = jo.getJSONArray("volume_set");
		JSONObject jo1 = ja1.getJSONObject(0);
		JSONArray ja2 = jo1.getJSONArray("instance");
		JSONObject jo2 = ja2.getJSONObject(0);
		System.out.println(jo2);
	}
}
